import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token:'',
    userInfo:'',
    stationId:'',
    merchantInfo:'',
    storeId:'',
    // groupId:'',
    cityId:'',
    countyId:'',
    provId:'',
    streetId:'',
    niu:[],
    company:[],
    bus:'',
    hash:[],
    alltextwen:"",
    //shopcollecttwo:"",
    order:'',
    good:'',
    maitextall:"",
    dealerId:'',
    sales:'',
    dealerIds:'',
    // groupId:'',
    // cityId:'',
    // countyId:'',
    // provId:'',
    // streetId:'',
    setStoreSettings:'',
    storeName:''
    
  },
  mutations: {
    // shopcollectone(state,data){
    //   state.shopcollecttwo=data
    //   localStorage.setItem('shopcollecttwo',data)
    // },
    woyaomai(state,data){
      state.maitextall = data
      localStorage.setItem("maitextall",JSON.stringify(data))
    },
    alltext(state,data){
      state.alltextwen = data
      localStorage.setItem("alltextwen",data)
    },
    setToken(state,data){
      state.token=data
      localStorage.setItem('token',data)
    },
    setUserInfo(state,data){
      state.userInfo=data
      localStorage.setItem('userInfo',JSON.stringify(data))
    },
    setStationId(state,data){
      state.stationId=data
      localStorage.setItem('stationId',data)
    },
    setmerchantId(state,data){
      state.merchantInfo=data
      localStorage.setItem('merchantInfo',JSON.stringify(data))
    },
    setStore(state,data){
      state.storeId=data
      localStorage.setItem('storeId',JSON.stringify(data))
    },
    setStores(state,data){
      state.storeId=data
      localStorage.setItem('storeId',JSON.stringify(data))
    },
    setniu(state,data){
      state.niu = data
      localStorage.setItem('niu',JSON.stringify(data))
      console.log(123)
    },
    setcompany(state,data){
      state.company = data
      localStorage.setItem('company',JSON.stringify(data))
      console.log(456)
    },
    sethash(state,data){
      state.hash = data
      localStorage.setItem('hash',JSON.stringify(data))
    },
    setOrder(state,data){
      state.order=data
      localStorage.setItem('order',JSON.stringify(data))
    },
    setgood(state,data){
      state.good=data
      localStorage.setItem('good',JSON.stringify(data))
    },
    setdealerId(state,data){
      state.dealerId=data
      localStorage.setItem('dealerId',data)
    },
    setsales(state,data){
      state.sales=data
      localStorage.setItem('sales',JSON.stringify(data))
    },
    setDealerIds(state,data){
      state.dealerIds=data
      localStorage.setItem('dealerIds',JSON.stringify(data))
    },
    setStoreSettingsid(state,data){
      state.setStoreSettings=data
      localStorage.setItem('setStoreSettings',JSON.stringify(data))
    },
    setstoreName(state,data){
      state.setStoreSettings=data
      localStorage.setItem('storeName',JSON.stringify(data))
    },
    // setGroupId(state,data){
    //   state.groupId=data
    //   localStorage.setItem('groupId',JSON.stringify(data))
    // },
    // setcityId(state,data){
    //   state.cityId=data
    //   localStorage.setItem('cityId',data)
    // },
    // setcountyId(state,data){
    //   state.countyId=data
    //   localStorage.setItem('countyId',data)
    // },
    // setprovinceId(state,data){
    //   state.provinceId=data
    //   localStorage.setItem('provId',data)
    // },
    // setstreetId(state,data){
    //   state.streetId=data
    //   localStorage.setItem('streetId',data)
    // },
  },
  actions: {

  }
})
